﻿$(function () {
    $(".LoginSelectedLanguageCode").change(function () {
        var selectedVal = $(this).val();
        if (selectedVal != "") {
            parent.location = "/" + selectedVal + "/Language/Change/?returnUrl=/" + selectedVal + "/User/Login/";
        }
    });


    $(".SignUpSelectedLanguageCode").change(function () {
        var selectedVal = $(this).val();
        if (selectedVal != "") {
            parent.location = "/" + selectedVal + "/Language/Change/?returnUrl=/" + selectedVal + "/User/SignUp/";
        }
    });

    $(".ForgotPasswordSelectedLanguageCode").change(function () {
        var selectedVal = $(this).val();
        if (selectedVal != "") {
            parent.location = "/" + selectedVal + "/Language/Change/?returnUrl=/" + selectedVal + "/User/ForgotPassword/";
        }
    });
    $(".field-validation-error").parent().addClass("has-error");


    $("#LoginCaptchaRefresh").click(function () {
        $("#LoginCaptchaImage").attr("src", $("#LoginCaptchaImage").attr("src") + "?timestamp=" + new Date().getTime());
    });

    $("#SignUpCaptchaRefresh").click(function () {
        $("#SignUpCaptchaImage").attr("src", $("#SignUpCaptchaImage").attr("src") + "?timestamp=" + new Date().getTime());
    });

    $("#ForgotPasswordCaptchaRefresh").click(function () {
        $("#ForgotPasswordCaptchaImage").attr("src", $("#ForgotPasswordCaptchaImage").attr("src") + "?timestamp=" + new Date().getTime());
    });

});